package day03;

import java.util.Scanner;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/9
 */
/**输入学员的考试成绩，输出这学员考试成绩的级别。
        100      A级
    90~99    A级
    80~89    B级
    70~79    C级
    60~69    D级
        < 60     不合格*/
public class SwitchDemo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入考试成绩：");
        int grade = sc.nextInt();
        if(grade >= 0 && grade <= 100){
        switch (grade/10) {
            case 10:
            case 9:
                System.out.println("A级");
                break;
            case 8:
                System.out.println("B级");
                break;
            case 7:
                System.out.println("C级");
                break;
            case 6:
                System.out.println("D级");
                break;
            default:
                System.out.println("不合格");
                break;
        }
    }
        else {
            System.out.println("成绩输入不合理");
        }
    }
}
